#include <linux/init.h>
#include <linux/module.h>
#include <../drivers/gpu/drm/loongson/loongson_vbios.h>


extern struct loongson_system_configuration loongson_sysconf;

//extern struct loongson_vbios *vbios_start_for_debug;

//static struct loongson_vbios_crtc *ls_crtc0 = NULL, *ls_crtc1 = NULL;
//static struct loongson_vbios_connector *ls_connector0 = NULL, *ls_connector1 = NULL;
//static struct loongson_vbios_encoder *ls_encoder0 = NULL, *ls_encoder1 = NULL;

static int show_vbios_init(void)
{
	int ret;
	//char *vbios_start = (char *)vbios_start_for_debug;
  //


  printk(KERN_INFO "am: loongson_sysconf.vgabios_addr = %p\n", loongson_sysconf.vgabios_addr);

	//printk(KERN_INFO "cjh: ------------loongson_vbios--------------------\n");
	//printk(KERN_INFO "cjh: vbios_start:0x%lx\n", (char *)vbios_start_for_debug);
	//printk(KERN_INFO "cjh: crtc_num:%d\n", vbios_start_for_debug->crtc_num);
	//printk(KERN_INFO "cjh: crtc_offset:0x%x\n", vbios_start_for_debug->crtc_offset);
	//printk(KERN_INFO "cjh: connector_num:%d\n", vbios_start_for_debug->connector_num);
	//printk(KERN_INFO "cjh: connector_offset:0x%x\n", vbios_start_for_debug->connector_offset);
	//printk(KERN_INFO "cjh: encoder_num:%d\n", vbios_start_for_debug->encoder_num);
	//printk(KERN_INFO "cjh: encoder_offset:0x%x\n", vbios_start_for_debug->encoder_offset);


	//ls_crtc0 = (struct loongson_vbios_crtc *)(vbios_start + vbios_start_for_debug->crtc_offset);
	//printk(KERN_INFO "cjh: ------------loongson_crtc 0 0x%lx--------------------\n", (char *)ls_crtc0);
	//printk(KERN_INFO "cjh: next: 0x%x\n", ls_crtc0->next);
	//printk(KERN_INFO "cjh: crtc_id: %d\n", ls_crtc0->crtc_id);
	//printk(KERN_INFO "cjh: crtc_version: %d\n", ls_crtc0->crtc_version);
	//printk(KERN_INFO "cjh: crtc_max_freq: %d\n", ls_crtc0->crtc_max_freq);
	//printk(KERN_INFO "cjh: crtc_max_weight: %d\n", ls_crtc0->crtc_max_weight);
	//printk(KERN_INFO "cjh: crtc_max_height: %d\n", ls_crtc0->crtc_max_height);
	//printk(KERN_INFO "cjh: connector_id: %d\n", ls_crtc0->connector_id);
	//printk(KERN_INFO "cjh: phy_num: %d\n", ls_crtc0->phy_num);
	//printk(KERN_INFO "cjh: encoder_id: %d\n", ls_crtc0->encoder_id);
	//printk(KERN_INFO "cjh: reserver: %d\n", ls_crtc0->reserve);
	//printk(KERN_INFO "cjh: user_local_param: %d\n", ls_crtc0->use_local_param);

	//ls_crtc1 = (struct loongson_vbios_crtc *)(vbios_start + ls_crtc0->next);
	//printk(KERN_INFO "cjh: ------------loongson_crtc 1--------------------\n");
	//printk(KERN_INFO "cjh: next: 0x%x\n", ls_crtc1->next);
	//printk(KERN_INFO "cjh: crtc_id: %d\n", ls_crtc1->crtc_id);
	//printk(KERN_INFO "cjh: crtc_version: %d\n", ls_crtc1->crtc_version);
	//printk(KERN_INFO "cjh: crtc_max_freq: %d\n", ls_crtc1->crtc_max_freq);
	//printk(KERN_INFO "cjh: crtc_max_weight: %d\n", ls_crtc1->crtc_max_weight);
	//printk(KERN_INFO "cjh: crtc_max_height: %d\n", ls_crtc1->crtc_max_height);
	//printk(KERN_INFO "cjh: connector_id: %d\n", ls_crtc1->connector_id);
	//printk(KERN_INFO "cjh: phy_num: %d\n", ls_crtc1->phy_num);
	//printk(KERN_INFO "cjh: encoder_id: %d\n", ls_crtc1->encoder_id);
	//printk(KERN_INFO "cjh: reserve: %d\n", ls_crtc1->reserve);
	//printk(KERN_INFO "cjh: user_local_param: %d\n", ls_crtc1->use_local_param);


	//ls_connector0 = (struct loongson_vbios_connector *)(vbios_start + vbios_start_for_debug->connector_offset);
	//printk(KERN_INFO "cjh: ------------loongson_connector 0 0x%lx--------------------\n", (char *)ls_connector0);
	//printk(KERN_INFO "cjh: next: 0x%x\n", ls_connector0->next);
	//printk(KERN_INFO "cjh: crtc_id: %d\n", ls_connector0->crtc_id);
	//printk(KERN_INFO "cjh: edid_method: %d\n", ls_connector0->edid_method);
	//printk(KERN_INFO "cjh: i2c_type: %d\n", ls_connector0->i2c_type);
	//printk(KERN_INFO "cjh: i2c_id: %d\n", ls_connector0->i2c_id);
	//printk(KERN_INFO "cjh: encoder_id: %d\n", ls_connector0->encoder_id);
	//printk(KERN_INFO "cjh: type: %d\n", ls_connector0->type);
	//printk(KERN_INFO "cjh: hotplug: %d\n", ls_connector0->hotplug);
	//printk(KERN_INFO "cjh: hot_swap_irq: %d\n", ls_connector0->hot_swap_irq);
	//printk(KERN_INFO "cjh: edid_version: %d\n", ls_connector0->edid_version);

	//ls_connector1 = (struct loongson_vbios_connector *)(vbios_start + ls_connector0->next);
	//printk(KERN_INFO "cjh: ------------loongson_connector 1--------------------\n");
	//printk(KERN_INFO "cjh: next: 0x%x\n", ls_connector1->next);
	//printk(KERN_INFO "cjh: crtc_id: %d\n", ls_connector1->crtc_id);
	//printk(KERN_INFO "cjh: edid_method: %d\n", ls_connector1->edid_method);
	//printk(KERN_INFO "cjh: i2c_type: %d\n", ls_connector1->i2c_type);
	//printk(KERN_INFO "cjh: i2c_id: %d\n", ls_connector1->i2c_id);
	//printk(KERN_INFO "cjh: encoder_id: %d\n", ls_connector1->encoder_id);
	//printk(KERN_INFO "cjh: type: %d\n", ls_connector1->type);
	//printk(KERN_INFO "cjh: hotplug: %d\n", ls_connector1->hotplug);
	//printk(KERN_INFO "cjh: hot_swap_irq: %d\n", ls_connector1->hot_swap_irq);
	//printk(KERN_INFO "cjh: edid_version: %d\n", ls_connector1->edid_version);


	//ls_encoder0 = (struct loongson_vbios_encoder *)(vbios_start + vbios_start_for_debug->encoder_offset);
	//printk(KERN_INFO "cjh: ------------loongson_encoder 0 0x%lx--------------------\n", (char *)ls_encoder0);
	//printk(KERN_INFO "cjh: next: 0x%x\n", ls_encoder0->next);
	//printk(KERN_INFO "cjh: crtc_id: %d\n", ls_encoder0->crtc_id);
	//printk(KERN_INFO "cjh: connector_id: %d\n", ls_encoder0->connector_id);
	//printk(KERN_INFO "cjh: reserve: %d\n", ls_encoder0->reserve);
	//printk(KERN_INFO "cjh: config_type: %d\n", ls_encoder0->config_type);
	//printk(KERN_INFO "cjh: i2c_type: %d\n", ls_encoder0->i2c_type);
	//printk(KERN_INFO "cjh: i2c_id: %d\n", ls_encoder0->i2c_id);
	//printk(KERN_INFO "cjh: type: %d\n", ls_encoder0->type);

	//ls_encoder1 = (struct loongson_vbios_encoder *)(vbios_start + ls_encoder0->next);
	//printk(KERN_INFO "cjh: ------------loongson_encoder 1 0x%lx--------------------\n", (char *)ls_encoder1);
	//printk(KERN_INFO "cjh: next: 0x%x\n", ls_encoder1->next);
	//printk(KERN_INFO "cjh: crtc_id: %d\n", ls_encoder1->crtc_id);
	//printk(KERN_INFO "cjh: connector_id: %d\n", ls_encoder1->connector_id);
	//printk(KERN_INFO "cjh: reserve: %d\n", ls_encoder1->reserve);
	//printk(KERN_INFO "cjh: config_type: %d\n", ls_encoder1->config_type);
	//printk(KERN_INFO "cjh: i2c_type: %d\n", ls_encoder1->i2c_type);
	//printk(KERN_INFO "cjh: i2c_id: %d\n", ls_encoder1->i2c_id);
	//printk(KERN_INFO "cjh: type: %d\n", ls_encoder1->type);




	return 0;
}

static void show_vbios_exit(void)
{
	
	return ;
}

module_init(show_vbios_init);
module_exit(show_vbios_exit);

MODULE_LICENSE("GPL");

//MODULE_INFO(intree, "Y");

